package com.yowasa.xiuxian.engine.battle.buff;

import com.yowasa.xiuxian.annoations.Buff;
import com.yowasa.xiuxian.entity.bo.battle.BuffContent;
import com.yowasa.xiuxian.entity.bo.battle.TempUserBattle;

import java.math.BigDecimal;

@Buff(name="融毁")
public class RongHuiBuff implements BuffInterface {
    @Override
    public void effectBattleInfo(BuffContent content, TempUserBattle userBattle) {
        BigDecimal divide = new BigDecimal(userBattle.getChp()).divide(new BigDecimal(userBattle.getHp()), 2,BigDecimal.ROUND_HALF_UP);
        BigDecimal res = new BigDecimal("1").subtract(divide).divide(new BigDecimal("3"), 2, BigDecimal.ROUND_HALF_UP);

        double v = 1.2 + res.doubleValue();
        userBattle.setSpell((int) (userBattle.getSpell() * v));

    }
}
